home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 1 / PC Actual CD 01.iso / f1 / cimb.arj / TECLAS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-03  |  3.2 KB  |  130 lines

  1. /*==============================================================================
  2.  
  3. FICHERO: TECLAS.H
  4.  
  5. AUTOR: ANTONIO LADESA JURADO
  6.  
  7. FECHA: 24/6/94
  8.  
  9. DESCRIPCION:
  10.  
  11.     Fichero de cabecera del módulo TECLAS.C
  12.  
  13.     Declara las constantes, estructuras, variables y funciones de control
  14.     de eventos y visualización de teclas,    textos y mensajes ofrecidas por
  15.     dicho módulo.
  16.  
  17. ==============================================================================*/
  18.  
  19.     /* eventos */
  20. #define NO_EVENTO 0
  21.  
  22.     /* codigos de teclado */
  23. #define ARRIBA 328
  24. #define ABAJO 336
  25. #define IZQ 331
  26. #define DER 333
  27. #define ORIGEN 327
  28. #define FIN 335
  29. #define PGARR 329
  30. #define PGABJ 337
  31. #define INSERT 338
  32. #define BORRAR 339
  33. #define DEL 8
  34. #define ESC 27
  35. #define RET 13
  36. #define F1 315
  37. #define F2 316
  38. #define F3 317
  39. #define F4 318
  40. #define F5 319
  41. #define F6 320
  42. #define F7 321
  43. #define F8 322
  44. #define F9 323
  45. #define F10 324
  46.  
  47.     /* número de marcos y teclas */
  48. #define NUM_MARCOS 8
  49. #define NUM_TECLAS 49
  50.  
  51.     /* texto maximo por tecla */
  52. #define MAX_TEXTO 15
  53.  
  54.     /* estados de la tecla */
  55. #define ON 1
  56. #define OFF 0
  57.  
  58.     /* definicion de una tecla */
  59. struct TECLA
  60.     {
  61.     int x;int y;            /* coordenadas (x,y) superior izquierda */
  62.     int ancho;int alto;     /* ancho y alto de la tecla */
  63.     char e;                 /* estado de la tecla */
  64.     char texto[MAX_TEXTO];  /* texto de la tecla */
  65.     };
  66.  
  67.     /* estructura para lectura de eventos */
  68. struct EVENTO
  69.     {
  70.     int x;    /* coordenadas de pulsación del ratón */
  71.     int y;
  72.     int e;  /* evento leído */
  73.     };
  74.  
  75.     /* estructura de acciones a realizar */
  76. struct ACCION
  77.     {
  78.     int opcion;        /* opción a realizar */
  79.     int tipo;          /* tipo de fichero (Formato gráfico */
  80.     char fichero[80];  /* fichero actual sobre el que se actúa */
  81.     };
  82.  
  83.     /* colores de las teclas en modo 16 colores VGA,VGAHI*/
  84. #define c1 WHITE
  85. #define c2 BLACK
  86. #define c3 LIGHTGRAY
  87. #define c4 DARKGRAY
  88. #define c5 DARKGRAY
  89. #define c6 LIGHTGRAY
  90. #define c7 LIGHTBLUE
  91.  
  92.     /* marcos y teclas definidos */
  93. extern struct TECLA marcos[NUM_MARCOS];
  94. extern struct TECLA teclas[NUM_TECLAS];
  95.  
  96.     /* dibujar una tecla */
  97. extern void TECLAponer(struct TECLA *t);
  98.  
  99.     /* resaltar una tecla */
  100. extern void TECLAresaltar(struct TECLA *t);
  101.  
  102.     /* activar una tecla */
  103. extern void TECLAactivar(struct TECLA *t);
  104.  
  105.     /* desactivar una tecla */
  106. extern void TECLAdesactivar(struct TECLA *t);
  107.  
  108.     /* escribir un mensaje */
  109. extern void MENSAJEponer(int x,int y,int ancho,char *texto);
  110.  
  111.     /* escribir mesaje en la línea de estado */
  112. extern void ESTADOponer(char *texto);
  113.  
  114.     /* limpiar la línea de estado */
  115. extern void ESTADOquitar(void);
  116.  
  117.     /*  escribir un texto sobre el fondo actual */
  118. extern void TEXTOponer(int x,int y,char *texto);
  119.  
  120.     /* escribir un texto, resaltándolo sobre un rectángulo */
  121. extern void TEXTOresaltar(int x,int y,int ancho,char *texto);
  122.  
  123.     /* Leer una serie de caracteres del dispositivo de entrada */
  124. extern char *LeerCadena(int x,int y,int ancho,char *cad);
  125.  
  126.     /* Leer un evento: Pulsación de tecla o botón del ratón */
  127. extern struct EVENTO leer_evento(struct EVENTO evento);
  128.  
  129.     /* Determinar que tecla o area se ha pulsado con el ratón */
  130. extern int TestTecla(int x,int y);